package com.application;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.application.base.BaseActivity;
import com.application.databinding.ActivitySqliteMainBinding;
import com.application.util.ARouterConstants;
import com.application.viewmodel.EmptyViewModel;

@Route(path = ARouterConstants.ACTIVITY_URL_SQLITE_MAIN)
public class SQLiteMainActivity extends BaseActivity<ActivitySqliteMainBinding, EmptyViewModel> {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected int initLayoutId() {
        return R.layout.activity_sqlite_main;
    }

    @Override
    protected int initVariableId() {
        return BR.sqliteMainViewModel;
    }

    @Override
    protected void initData() {
        super.initData();
        binding.setActivity(this);
    }

    public void insertData(View view){
        ARouter.getInstance()
                .build(ARouterConstants.ACTIVITY_URL_SQLITE_INSERT)
                .navigation(this);
    }
    public void deleteData(View view){
        ARouter.getInstance()
                .build(ARouterConstants.ACTIVITY_URL_SQLITE_DELETE)
                .navigation(this);
    }
    public void updateData(View view){
        ARouter.getInstance()
                .build(ARouterConstants.ACTIVITY_URL_SQLITE_UPDATE)
                .navigation(this);
    }
    public void queryData(View view){
        ARouter.getInstance()
                .build(ARouterConstants.ACTIVITY_URL_SQLITE_QUERY)
                .navigation(this);
    }
}